package _1011.optional;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

import org.junit.Test;

public class DateTimeDemo {

	@Test
	public void local() {
		LocalDate d = LocalDate.now();
		System.out.println(d);
		System.out.println(d.getYear());
		System.out.println(d.getMonthValue());
		System.out.println(d.getDayOfMonth());
		System.out.println(d.getDayOfYear());
		
		LocalTime t = LocalTime.now();
		System.out.println(t);
		System.out.println(t.getHour());
		System.out.println(t.getMinute());
		System.out.println(t.getSecond());
		
		LocalDateTime dt = LocalDateTime.now();
		System.out.println(dt);
	}
	
	@Test
	public void local2() {
		LocalDate d = LocalDate.of(2000, 4, 12);
		System.out.println(d);
		System.out.println(d.getYear());
		System.out.println(d.getMonthValue());
		System.out.println(d.getDayOfMonth());
		System.out.println(d.getDayOfYear());
		
		LocalTime t = LocalTime.of(12, 12,12,100);
		System.out.println(t);
		System.out.println(t.getHour());
		System.out.println(t.getMinute());
		System.out.println(t.getSecond());
		
		LocalDateTime dt = LocalDateTime.of(2012, 12, 12, 11, 11,11,110);
		System.out.println(dt);
	}
}
